<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改餐厅菜单')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-WxCanteenMenu-edit" th:object="${wxCanteenMenu}">
        <input name="menuId" th:field="*{menuId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">菜品名称：</label>
            <div class="col-sm-10">
                <input name="menuName" id="menuName" th:field="*{menuName}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">菜品图片：</label>
            <div class="col-sm-10">
                <input id="menuPic" th:value="*{menuPic}" type="hidden">
                <div class="upload" action='upload.html' data-num="1" data-value='' id='piclist_menuPic'></div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">单位：</label>
            <div class="col-sm-10">
                <input name="menuUnit" id="menuUnit" th:field="*{menuUnit}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">菜品价格：</label>
            <div class="col-sm-10">
                <input name="menuPrice" id="menuPrice" th:field="*{menuPrice}" class="form-control" type="text"
                       required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">排序：</label>
            <div class="col-sm-10">
                <input name="menuSort" id="menuSort" th:field="*{menuSort}" class="form-control" type="text" required>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "wechat/WxCanteenMenu";


    $("#form-WxCanteenMenu-edit").validate({
        focusCleanup: true
    });


    //轮播图上传
    $("#piclist_menuPic").attr("data-value", $("#menuPic").val())
    $("#piclist_menuPic").upload(function () {
    }, "menuPic")


    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-WxCanteenMenu-edit').serialize());
        }
    }
</script>
</body>
</html>
